package com.json;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhr
 */
public class TJ {
    public static void main(String[] args) throws JsonProcessingException {

        Map<Long, String> map = new HashMap<>();
        map.put(2L, "2");
        System.out.println(JSON.toJSONString(map));
//        System.out.println(new ObjectMapper().wri(map));

        Map<String, String> map1 = new HashMap<>();
        map1.put("2", "2");
        System.out.println(JSON.toJSONString(map1));
        System.out.println(new ObjectMapper().writeValueAsString(map1));




    }



}
